package cloudbus

// 区分on和onLocal: 一个是通过消息总线触发，一个是在当前JVM进程内触发——这意味着一个支持ManagerNode集群事件，一个只支持单个MN事件. 应用场景: 有些事情需要MN一起做，有些事情一个MN做了其他MN就不用做了
type EventFacade interface {
	OnAutoOffEventCallback(path string, cb AutoOffEventCallback)
	OnEventCallback(path string, cb EventCallback)
	OnEventRunnable(path string, runnable EventRunnable)
	Off(cb AbstractEventFacadeCallback)
	OnLocalAutoOffEventCallback(path string, cb AutoOffEventCallback)
	OnLocalEventCallback(path string, cb EventCallback)
	OnLocalEventRunnable(path string, runnable EventRunnable)
	Fire(path string, data interface{})
	IsFromThisManagementNode(tokens map[string]string) bool
}

const (
	META_DATA_MANAGEMENT_NODE_ID = "metadata::managementNodeId"
	META_DATA_PATH               = "metadata::path"
	WEBHOOK_TYPE                 = "CanonicalEvent"
)
